<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<!-- Copyright 1997 The Open Group, All Rights Reserved -->
<title>errno</title>
</head><body bgcolor=white>
<center>
<font size=2>
The Single UNIX &reg; Specification, Version 2<br>
Copyright &copy; 1997 The Open Group

</font></center><hr size=2 noshade>
<h4><a name = "tag_000_003_262">&nbsp;</a>NAME</h4><blockquote>
errno - XSI error return value
</blockquote><h4><a name = "tag_000_003_263">&nbsp;</a>SYNOPSIS</h4><blockquote>
<pre><code>

#include &lt;<a href="errno.h.html">errno.h</a>&gt;
</code>
</pre>
</blockquote><h4><a name = "tag_000_003_264">&nbsp;</a>DESCRIPTION</h4><blockquote>
<p>
<i>errno</i>
is used by many XSI functions to return error values.
<p>
Many functions provide an error number in
<i>errno</i>
which has type
<b>int</b>
and is defined in
<i><a href="errno.h.html">&lt;errno.h&gt;</a></i>.
The value of
<i>errno</i>
will be defined only after a call to a function for which it is explicitly
stated to be set and until it is changed by the next function call.
The value of
<i>errno</i>
should only be examined when it is indicated to be valid by a function's
return value.  Programs should obtain the definition of
<i>errno</i>
by the inclusion of
<i><a href="errno.h.html">&lt;errno.h&gt;</a></i>.
The practice of defining
<i>errno</i>
in a program as
<b>extern&nbsp;int</b>
<i>errno</i>
is obsolescent.  No function in this specification sets
<i>errno</i>
to 0 to indicate an error.
<p>
It is unspecified whether
<i>errno</i>
is a macro or an identifier declared with
external linkage.  If a macro definition is suppressed in order to access an
actual object, or a program defines an identifier with the name <b>errno</b>,
the behaviour is undefined.
<p>
The
symbolic values stored in
<i>errno</i>
are documented in the ERRORS sections on all relevant pages.
</blockquote><h4><a name = "tag_000_003_265">&nbsp;</a>RETURN VALUE</h4><blockquote>
None.
</blockquote><h4><a name = "tag_000_003_266">&nbsp;</a>ERRORS</h4><blockquote>
None.
</blockquote><h4><a name = "tag_000_003_267">&nbsp;</a>EXAMPLES</h4><blockquote>
None.
</blockquote><h4><a name = "tag_000_003_268">&nbsp;</a>APPLICATION USAGE</h4><blockquote>
Previously both POSIX and X/Open documents were more restrictive than the
ISO&nbsp;C standard in that they required
<i>errno</i>
to be defined as an external variable, whereas the ISO&nbsp;C standard required
only that
<i>errno</i>
be defined as a modifiable <b>lvalue</b> with type
<b>int</b>.
<p>
A program that uses
<i>errno</i>
for error checking should set it to 0 before a function
call, then inspect it before a subsequent function call.
</blockquote><h4><a name = "tag_000_003_269">&nbsp;</a>FUTURE DIRECTIONS</h4><blockquote>
None.
</blockquote><h4><a name = "tag_000_003_270">&nbsp;</a>SEE ALSO</h4><blockquote>
<i><a href="errno.h.html">&lt;errno.h&gt;</a></i>,
<a href="errors.html">errors</a>.
</blockquote><h4>DERIVATION</h4><blockquote>
Derived from Issue 1 of the SVID.
</blockquote><hr size=2 noshade>
<center><font size=2>
UNIX &reg; is a registered Trademark of The Open Group.<br>
Copyright &copy; 1997 The Open Group
<br> [ <a href="../index.html">Main Index</a> | <a href="../xshix.html">XSH</a> | <a href="../xcuix.html">XCU</a> | <a href="../xbdix.html">XBD</a> | <a href="../cursesix.html">XCURSES</a> | <a href="../xnsix.html">XNS</a> ]

</font></center><hr size=2 noshade>
</body></html>

